import { createRouter, createWebHistory } from 'vue-router';
import WordList from '../components/WordList.vue';
import WordEditor from '../components/WordEditor.vue';

const routes = [
    {
        path: '/',
        name: 'WordList',
        component: WordList
    },
    {
        path: '/edit-word/:wordId',
        name: 'EditWord',
        component: WordEditor,
        props: true
    }
];

const router = createRouter({
    history: createWebHistory(import.meta.env.VUE_APP_BASE_URL || '/'),

    routes
});

export default router;